import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

const constantRoutes = [
    {
        path: '/404',
        component: () => import('@/views/error/404'),
        hidden: true
    },
    {
        path: '/401',
        component: () => import('@/views/error/401'),
        hidden: true
    },
    {
        path: '/home',
        component: () => import('@/views/home'),
        hidden: true
    },
    {
        path: '', component: () => import('@/layout'),
        redirect: 'index',
        children: [{path: 'index', component: () => import('@/views'),},
            {path: 'login', component: () => import('@/views/login'),},
            {path: 'register', component: () => import('@/views/register'),},
            {
                path: 'person', component: () => import('@/views/person'),
                redirect: 'person/info',
                children: [
                    {
                        path: 'info',
                        component: () => import('@/views/person/info'),
                    },
                    {
                        path: 'account',
                        component: () => import('@/views/person/info/account'),
                    },
                    {
                        path: 'setting',
                        component: () => import('@/views/person/info/setting'),
                    },
                    {
                        path: 'auth',
                        component: () => import('@/views/person/auth'),
                    },
                    {
                        path: 'balance',
                        component: () => import('@/views/person/payment/balance'),
                    },
                    {
                        path: 'recharge',
                        component: () => import('@/views/person/payment/recharge'),
                    },
                    {
                        path: 'withdrawal',
                        component: () => import('@/views/person/payment/withdrawal'),
                    },
                    {
                        path: 'income',
                        component: () => import('@/views/person/payment/income'),
                    },
                    {
                        path: 'expenditure',
                        component: () => import('@/views/person/payment/expenditure'),
                    },
                    {
                        path: 'bill',
                        component: () => import('@/views/person/payment/bill'),
                    },
                    {
                        path: 'bankCard',
                        component: () => import('@/views/person/payment/bankCard'),

                    },
                    {
                        path: 'bankCard2',
                        component: () => import('@/views/person/payment/bankCard/cardsList'),
                    },

                    {
                        path: 'authNotice',
                        component: () => import('@/views/person/auth/components/AuthNotice'),
                    },
                ]
            },]
    },
]


export default new Router({
    mode: 'history', // 去掉url中的#
    routes: constantRoutes
})


